package com.ms.common.context;

import java.util.Map;
import java.util.Objects;

import lombok.Data;

@Data
public class TokenInfo {

	private Long userId;

	private String nickName;

	private String name;

	private Long companyId;

	private Long staffId;

	private String imUserId;

	private Integer userType;

	private Integer accountType;

	private Integer grantType;

	private long expireTime;

	private Map<String, String> otherInfo;

	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (o == null || getClass() != o.getClass()) {
			return false;
		}

		TokenInfo jwtInfo = (TokenInfo) o;

		if (!Objects.equals(userId, jwtInfo.userId)) {
			return false;
		}
		return Objects.equals(userId, jwtInfo.userId);

	}

	@Override
	public int hashCode() {
		int result = nickName != null ? nickName.hashCode() : 0;
		result = 31 * result + (userId != null ? userId.hashCode() : 0);
		return result;
	}

}
